package com.example.littleken.mytao.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.littleken.mytao.R;
import com.example.littleken.mytao.util.LoginActivity;

/**
 * 我的界面视图（MeFragment）
 */

public class MeFragment extends Fragment{
    @Nullable
    protected Button btn_login;
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_me,container,false);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        //当我的界面被创建时，初始化登录按钮
        super.onActivityCreated(savedInstanceState);
        btn_login = (Button) getView().findViewById(R.id.btn_login);
        btn_login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //设置点击事件，跳转到登录界面
                Intent intent = new Intent(getActivity(),LoginActivity.class);
                startActivity(intent);
            }
        });
    }
}
